<%-- Copyright (c) 2005 BroadVision, Inc. All rights reserved              --%>
<%-- The product described in this manual may be protected by one or more  --%>
<%-- U.S. and International patents. The BroadVision One-To-One software   --%>
<%-- is covered by U.S. patent 5,710,887.                                  --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and the BroadVision logo are registered       --%>
<%-- trademarks, and BroadVision One-To-One is a trademark of BroadVision, --%>
<%-- Inc. IONA and Orbix are trademarks of IONA Technologies, Ltd. RSA,    --%>
<%-- MD5, and RC2 are trademarks of RSA Data Security, Inc. All other      --%>
<%-- trademarks, service marks, and trade names belong to their respective --%>
<%-- owners. BroadVision, Inc. disclaims any proprietary interest in the   --%>
<%-- marks and names of others.                                            --%>
<%--                                                                       --%>

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/bv-html.tld" prefix="bvhtml" %> 

<%-- This holds the current notification type. "email" or "alert". --%>
<c:set var="notifType" value="${notifType}" />

<c:if test='${notifType == "email"}'>
<c:set var="viewBean" value="${emEmailSummaryEditView}" />
<c:set var="formBean" value="${emEmailSummaryEditForm}" />
<c:set var="formBeanName" value="emEmailSummaryEditForm" />
<c:set var="actionPath" value="/em/notif/emailSummarySave" />
</c:if>
<c:if test='${notifType == "alert"}'>
<c:set var="viewBean" value="${emAlertSummaryEditView}" />
<c:set var="formBean" value="${emAlertSummaryEditForm}" />
<c:set var="formBeanName" value="emAlertSummaryEditForm" />
<c:set var="actionPath" value="/em/notif/alertSummarySave" />
</c:if>

<c:set var="formBeanMap" value="${formBean.map}" />
<c:set var="viewBeanMap" value="${viewBean.map}" />


<script language="javascript"
	src="<%=request.getContextPath()%>/mc/js/date.js"
	type="text/javascript"></script>
	
<SCRIPT language="javascript1.2">
	function checkMaxLength(taText,len)	{
	    if (taText.value.length > len)
	        taText.blur();
	}

	// function to POST form parameters to a ".do"
	function doAction(action, myform) {
	    myform.action='<html:rewrite page="'+action+'" />';
	    myform.submit();
	    return true;
	}

    function validateFrequencyField (myform) {
      var isValid = true;
      if (myform.scheduleType.value == "bv_hour") {
        // frequency field is required and has to be integer type.
        if ((myform.frequency == null) || 
            (trim(myform.frequency.value).length == 0) ) {
          alert(" <bean:message bundle="em" key="em.notif.summaryEdit.alert.frequencyRequired" /> ");            
          isValid = false;
        }
        else if (!isAllDigits(myform.frequency.value)) {
          alert(" <bean:message bundle="em" key="em.notif.summaryEdit.alert.frequencyDigitOnly" /> ");
          isValid = false;        
        }
      }
      return isValid;
    }
    
     function validateForm(myform) {
	  var isValid = true;
	  // do the struts client side validation first.	
      if (!validate(myform)) {
        isValid = false;
      }
      else {
        isValid = validateFrequencyField(myform);
	  }
	  <c:if test='${notifType == "email"}'>
	  	formName = "emEmailSummaryEditForm";
	  </c:if>
          <c:if test='${notifType == "alert"}'>
          	formName = "emAlertSummaryEditForm";
	  </c:if>
	  
	  if( myform.scheduleType.value == "bv_onetime") {
	  	var now = new Date();
	  	var schedStartDate = getDate(formName,"startDate");
	  	if( schedStartDate < now) {
	  		isValid = confirm('<bean:message key="em.notif.summaryEdit.confirm.datePast" bundle="em"/>');
	        }
	  }	  	
	  if (myform.scheduleType.value == "bv_hour" ) {	      
	  	      
	      var schedStartDate = getDate(formName,"startDate");
	      var schedEndDate = getDate(formName,"endDate"); 
	      if ( schedStartDate >= schedEndDate) {
	  	   alert('<bean:message key="em.notif.summaryEdit.alert.datesInvalid" bundle="em"/>');
	  	   return false;
	      }
	      var now = new Date();
	      if( schedStartDate < now) {
	      	   isValid = confirm('<bean:message key="em.notif.summaryEdit.confirm.datePast" bundle="em"/>');
	      }
     	  }
     	  if( myform.scheduleType.value == "bv_day"  ||
	      myform.scheduleType.value == "bv_week" ||
	      myform.scheduleType.value == "bv_month") {
	      
	      var now = new Date();
	      var currentDate = new Date( now.getYear(), now.getMonth(), now.getDate(), 0, 0, 0);

	      var schedStartDate = getDateOnly( formName,"startDate");
	      var schedEndDate = getDateOnly( formName,"endDate"); 
	      if ( schedStartDate >= schedEndDate) {
	      	  alert('<bean:message key="em.notif.summaryEdit.alert.datesInvalid" bundle="em"/>');
	      	  return false;
	      }
	      	      
	      if( schedStartDate < currentDate)  {
	      	   isValid = confirm('<bean:message key="em.notif.summaryEdit.confirm.datePast" bundle="em"/>');
	      }	      
	  }
     
	  return isValid;
	}

	function changeSchedType(myform) {
	  <c:choose>
	    <c:when test='${formBeanMap.currentAction == "create"}'>
	      <c:choose>
          <c:when test='${notifType == "email"}'>
	      myform.action='<html:rewrite page="/em/notif/emailCreate.do" />';
	      </c:when>
          <c:when test='${notifType == "alert"}'>
	      myform.action='<html:rewrite page="/em/notif/alertCreate.do" />';
	      </c:when>
	      </c:choose>
	    </c:when>
	    <c:when test='${formBeanMap.currentAction == "edit"}'>
	      <c:choose>
          <c:when test='${notifType == "email"}'>
	      myform.action='<html:rewrite page="/em/notif/emailSummaryEdit.do" />';
	      </c:when>
          <c:when test='${notifType == "alert"}'>
	      myform.action='<html:rewrite page="/em/notif/alertSummaryEdit.do" />';
	      </c:when>
	      </c:choose>
	    </c:when>
	  </c:choose>    
	  myform.fromRefresh.value = "true";
	  myform.submit();
	  return true;  
	}
	
	function doSave (myform) {
      myform.name.value = myform.name.value.replace(/^\s+/g, '').replace(/\s+$/g, '');
      
      if (validateForm(myform)){
        if (myform.scheduleType.value == "bv_week") {
          <!-- ***** bv_week **** -->
          if (myform.dayList) {
             //dayList is a valid form object.
             if (myform.dayList.selectedIndex == -1) {
               alert('<bean:message bundle="em" key="em.notif.summaryEdit.alert.weekDayRrequired"/>');
               return false;
             }
          }
        }
	    <c:choose>
          <c:when test='${notifType == "email"}'>
	      myform.action='<html:rewrite page="/em/notif/emailSummarySave.do" />';
	      </c:when>
          <c:when test='${notifType == "alert"}'>
	      myform.action='<html:rewrite page="/em/notif/alertSummarySave.do" />';
	      </c:when>
	    </c:choose>
        myform.submit();
	    return true;	    
      }
      else {
        return false;
      }
	}

    // When clicking cancel button, if it is creating new email, it will forward
    // to the email search page. If it is editing existing email, it will forward
    // to the view page of the current email.
	function doCancel(myform) {
	  <c:choose>
	    <c:when test='${formBeanMap.currentAction == "create"}'>
	      <c:choose>
          <c:when test='${notifType == "email"}'>
	      myform.action='<html:rewrite page="/em/notif/emailSearch.do" />';
	      </c:when>
          <c:when test='${notifType == "alert"}'>
	      myform.action='<html:rewrite page="/em/notif/alertSearch.do" />';
	      </c:when>
	      </c:choose>
	    </c:when>
	    <c:when test='${formBeanMap.currentAction == "edit"}'>
	      <c:choose>
          <c:when test='${notifType == "email"}'>
	      myform.action='<html:rewrite page="/em/notif/emailSummaryView.do" />';
	      </c:when>
          <c:when test='${notifType == "alert"}'>
	      myform.action='<html:rewrite page="/em/notif/alertSummaryView.do" />';
	      </c:when>
	      </c:choose>
	    </c:when>
	  </c:choose>
	  myform.submit();
	  return true;
	}      
	
    // When clicking reset button, if it is creating new email, it will reset the
    // form fields by the default values, and goto the email create page again.
    // If it is editing existing email, it will reset the form fields by the values
    // loaded from the database of the current email, and goto the email edit 
    // page again.
	function doReset(myform) {
	  <c:choose>
	    <c:when test='${formBeanMap.currentAction == "create"}'>
	      <c:choose>
          <c:when test='${notifType == "email"}'>
	      myform.action='<html:rewrite page="/em/notif/emailCreate.do" />';
	      </c:when>
          <c:when test='${notifType == "alert"}'>
	      myform.action='<html:rewrite page="/em/notif/alertCreate.do" />';
	      </c:when>
	      </c:choose>	    
	    </c:when>
	    <c:when test='${formBeanMap.currentAction == "edit"}'>
	      <c:choose>
          <c:when test='${notifType == "email"}'>
	      myform.action='<html:rewrite page="/em/notif/emailSummaryEdit.do" />';
	      </c:when>
          <c:when test='${notifType == "alert"}'>
	      myform.action='<html:rewrite page="/em/notif/alertSummaryEdit.do" />';
	      </c:when>
	      </c:choose>	    
	    </c:when>
	  </c:choose>
	  // fromRefresh is set to false in hidden field, 
	  // so it knows it needs to reload the fields from DB.
	  myform.fromRefresh.value = "false";
	  myform.submit();
	  return true;  	  
	}

</SCRIPT>

<html-el:javascript formName="${formBeanName}" method="validate" />


<!--start zone 5 content area-->
<table width="100%" border="0" cellspacing="0" cellpadding="0"
       class="zoneFive">
  <tr> 
    <td valign="top" width="100%">
      <div class="pageTitle">
        <c:choose>
          <c:when test='${formBeanMap.currentAction == "create"}'>
	        <c:choose>
            <c:when test='${notifType == "email"}'>
	        <bean:message bundle="em" key="emarketing.notif.emailCreate.pageTitle"/>
            </c:when>
            <c:when test='${notifType == "alert"}'>
	        <bean:message bundle="em" key="em.notif.alertCreate.pageTitle"/>
            </c:when>
	        </c:choose>	
          </c:when>
          <c:when test='${formBeanMap.currentAction == "edit"}'>          
	        <c:choose>
            <c:when test='${notifType == "email"}'>
	        <bean:message bundle="em" key="emarketing.notif.emailSummaryEdit.pageTitle"/> : 
            </c:when>
            <c:when test='${notifType == "alert"}'>
	        <bean:message bundle="em" key="em.notif.alertSummaryEdit.pageTitle"/> : 
            </c:when>
	        </c:choose>	
            <c:out value="${formBeanMap.name}" />
          </c:when>
        </c:choose>

      </div>
      <div class="errorMessage"><html:errors bundle="em"/></div>
      <div><jsp:include page="/mc/common/pagetab.jsp" flush="true" /></div>
            
      <div class="pageInstructions">
        <c:choose>
          <c:when test='${formBeanMap.currentAction == "create"}'>
            <bean:message bundle="em" key="emarketing.notif.emailCreate.pageInstruction"/>
          </c:when>
          <c:when test='${formBeanMap.currentAction == "edit"}'>
            <bean:message bundle="em" key="em.notif.emailSummaryEdit.pageInstruction"/>          
          </c:when>
        </c:choose>          
      </div>

      <div class="pageSubtitle">
        <c:choose>
        <c:when test='${formBeanMap.currentAction == "create"}'>
          <c:choose>
            <c:when test='${notifType == "email"}'>
	        <bean:message bundle="em" key="emarketing.notif.emailCreate.pageSubtitle.newemail"/>
            </c:when>
            <c:when test='${notifType == "alert"}'>
	        <bean:message bundle="em" key="em.notif.alertCreate.pageSubtitle.newalert"/>
            </c:when>
	      </c:choose>	          
        </c:when>
        <c:when test='${formBeanMap.currentAction == "edit"}'>
          <c:choose>
            <c:when test='${notifType == "email"}'>
            <bean:message bundle="em" key="emarketing.notif.emailSummaryEdit.pageSubtitle"/>:
            </c:when>
            <c:when test='${notifType == "alert"}'>
            <bean:message bundle="em" key="em.notif.alertSummaryEdit.pageSubtitle"/>:
            </c:when>
	      </c:choose>	          
          <c:out value="${formBeanMap.name}" />  
        </c:when>
        </c:choose>
      </div>

      <html-el:form action="${actionPath}">
        <html:hidden property="currentAction"/>
        <html:hidden property="fromRefresh" value="false"/>
        <c:choose>
          <c:when test='${formBeanMap.currentAction == "create"}'>          
            <html:hidden property="existing" value="false"/>
          </c:when>
          <c:when test='${formBeanMap.currentAction == "edit"}'> 
            <html:hidden property="oid"/>
            <html:hidden property="existing" value="true"/>
          </c:when>
        </c:choose>
              
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="labelForm">
        <tr> 
          <td class="label" width="20%">
          <c:choose>
            <c:when test='${notifType == "email"}'>        
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.name"/>*: 
            </c:when>
            <c:when test='${notifType == "alert"}'> 
            <bean:message bundle="em" key="em.notif.alertSummaryEdit.label.name"/>*:      
            </c:when>
          </c:choose>   
          </td>
          <td class="labelField" width="80%">
			<html:messages id="nameError" property="notifName" bundle="em" />
			<c:if test="${not empty nameError}">
			  <span class="errorMessage">
			    <c:out value="${nameError}" />
			  </span>
			  <br>
            </c:if>		
            <html:text property="name" size="30"/>
          </td>
        </tr>
          
        <tr>        
          <td class="label" width="20%"> 
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.description"/>: 
          </td>
          <td class="labelField" width="80%">
            <html:textarea property="description" rows="3" cols="50" />
          </td>     
        </tr>
        
        <tr>        
          <td class="label" width="20%"> 
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.status"/>: 
          </td>
          <td class="labelField" width="80%">
          <c:choose>
          <c:when test='${formBeanMap.currentAction == "create"}'>
            <%-- It is always offline for create email/alert page.
                 Show disable radio buttons. --%>
            <html:radio property="onlineStatus" value="1" disabled="true" />
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.online"/>                 
            <html:radio property="onlineStatus" value="0" disabled="true" />
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.offline"/>          
          </c:when>
          <c:when test='${formBeanMap.currentAction == "edit"}'>
            <%-- If it is email edit page, it can only set to online if
                 the canSetOnline flag is true. --%>          
            <c:choose>
              <c:when test="${viewBeanMap.canSetOnline}">
                <html:radio property="onlineStatus" value="1" />
                <bean:message bundle="em" key="emarketing.notif.emailCreate.label.online"/>              
                <html:radio property="onlineStatus" value="0" />
                <bean:message bundle="em" key="emarketing.notif.emailCreate.label.offline"/>          
              </c:when>
              <c:otherwise>
                <%-- show disable radio buttons. --%>
                <html:radio property="onlineStatus" value="1" disabled="true" />
                <bean:message bundle="em" key="emarketing.notif.emailCreate.label.online"/>                
                <html:radio property="onlineStatus" value="0" disabled="true" />
                <bean:message bundle="em" key="emarketing.notif.emailCreate.label.offline"/>          
              </c:otherwise>
            </c:choose>
          </c:when>
          </c:choose>

          </td>
        </tr>

        <tr>        
          <td class="label" width="20%"> 
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.deliveryType"/>: 
          </td>
          <td class="labelField" width="80%">
            <html:select property = "deliveryType" size="1">
              <html:optionsCollection name="viewBean" property="deliveryTypes"/>       
            </html:select>          
          </td>     
        </tr>
        
        <%-- Show choices of alert types, if this is an alert --%>
        <c:if test='${notifType == "alert"}'>
        <tr> 
          <td class="label" width="20%">
            <bean:message bundle="em" key="em.notif.alertSummary.label.alertType"/>: 
          </td>
          <td class="labelField" width="80%">
            <html:select property = "alertType" size="1">
              <html:optionsCollection name="viewBean" property="alertTypes"/>       
            </html:select>  
          </td>           
        </tr>
        </c:if>
        
      </table>

      <div class="pageSubtitle">
        <span class="left">
          <bean:message bundle="em" key="emarketing.notif.emailCreate.pageSubtitle.schedule"/>
        </span>
        <span class="right">
        </span>
      </div>

      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="labelForm" summary="Mailing Schedule">
        <tr> 
          <td class="label" width="20%">
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.scheduleType"/>*: 
          </td>
          <td class="labelField" width="80%">
            <html:select property="scheduleType" size="1" onchange="changeSchedType(this.form);">
              <html:optionsCollection name="viewBean" property="scheduleTypes"/>
			</html:select>
          </td>
        </tr>

		<tr> 
			<td class="label" width="20%">
			  <bean:message bundle="em" key="emarketing.notif.emailCreate.label.startDate"/>:
			</td>
			<td class="labelField" width="80%">
				<bvhtml:date property="startDate" onChangeMonth="onChangeMonth"
					onChangeYear="onChangeYear" noblank="true"/>
				<%-- TODO: Check if we can simply use ${formBean} in the argument
				           for datePopup. If so, then we don't need to add the
				           condition here. --%>
				<c:choose>
                <c:when test='${notifType == "email"}'>
				<a href="JavaScript:datePopup('<html:rewrite page="/mc/calendar.do"/>', 
				                              'emEmailSummaryEditForm', 
				                              'startDate')">
                </c:when>
                <c:when test='${notifType == "alert"}'>
                <a href="JavaScript:datePopup('<html:rewrite page="/mc/calendar.do"/>', 
				                              'emAlertSummaryEditForm', 
				                              'startDate')">
                </c:when>
                </c:choose>				
                  <html:img page="/mc/images/icons/calendar.gif" 
                            width="22" 
                            height="22" 
                            titleKey="emarketing.notif.emailCreate.altKey.chooseDate"
                            altKey="emarketing.notif.emailCreate.altKey.chooseDate" bundle="em"
                            border="0" 	
                            align="absmiddle"/>
                </a>		
			</td>
		</tr>

        <c:choose>
        <c:when test='${formBeanMap.scheduleType != "bv_onetime"}'>
		<tr> 
			<td class="label" width="20%">
			  <bean:message bundle="em" key="emarketing.notif.emailCreate.label.endDate"/>:
			</td>
			<td class="labelField" width="80%">
				<bvhtml:date property="endDate" onChangeMonth="onChangeMonth"
					onChangeYear="onChangeYear" noblank="true"/>
				
				<%-- TODO: Check if we can simply use ${formBean} in the argument
				           for datePopup. If so, then we don't need to add the
				           condition here. --%>
				<c:choose>
                <c:when test='${notifType == "email"}'>
				<a href="JavaScript:datePopup('<html:rewrite page="/mc/calendar.do"/>', 
				                              'emEmailSummaryEditForm', 
				                              'endDate')">
                </c:when>
                <c:when test='${notifType == "alert"}'>
                <a href="JavaScript:datePopup('<html:rewrite page="/mc/calendar.do"/>', 
				                              'emAlertSummaryEditForm', 
				                              'endDate')">
                </c:when>
                </c:choose>
                  <html:img page="/mc/images/icons/calendar.gif" 
                            width="22" 
                            height="22" 
                            titleKey="emarketing.notif.emailCreate.altKey.chooseDate"
                            altKey="emarketing.notif.emailCreate.altKey.chooseDate" bundle="em"
                            border="0" 	
                            align="absmiddle"/>
                </a>		
			</td>
		</tr>
        </c:when>
        </c:choose>

        <c:choose>
        <c:when test='${formBeanMap.scheduleType == "bv_day"}'>
        <!-- ***** bv_day **** -->        
        <tr>
          <td class="label" width="20%">
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.deliverMessageAt"/>:
          </td>
          <td class="labelField" width="80%">
            <bvhtml:time property="jobTime"/>
          </td>
        </tr>
        </c:when>		

        <c:when test='${formBeanMap.scheduleType == "bv_hour"}'>
		<!-- ***** bv_hour **** -->
		<tr>
		  <td class="label" width="20%">
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.startTime"/>:		  
		  </td>
          <td class="labelField" width="80%">
            <bvhtml:time property="startDate"/>
          </td>
		</tr>
		
		<tr>
		  <td class="label" width="20%">
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.endTime"/>:		  
		  </td>
          <td class="labelField" width="80%">
            <bvhtml:time property="endDate"/>
          </td>
		</tr>

		<tr>
		  <td class="label" width="20%">
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.every"/>*:		  
		  </td>
          <td class="labelField" width="80%">
            <html:text property="frequency" maxlength="5" size="3"/>
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.hour"/>
          </td>
		</tr>
        </c:when>

        <c:when test='${formBeanMap.scheduleType == "bv_onetime"}'>
		<!-- ***** bv_onetime **** -->
		<tr>
		  <td class="label" width="20%">
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.deliverMessageAt"/>:		  
		  </td>
          <td class="labelField" width="80%">
            <bvhtml:time property="startDate"/>
          </td>
		</tr>
		</c:when>

        <c:when test='${formBeanMap.scheduleType == "bv_week"}'>
		<!-- ***** bv_week **** -->
		<tr>
		  <td class="label" width="20%">
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.weekDay"/>*:		  
		  </td>
          <td class="labelField" width="80%">
            <html:select property="dayList" multiple="true" size="7">
              <html:optionsCollection name="viewBean" property="daysOfWeek"/>
			</html:select>
          </td>
		</tr>
		<tr>
		  <td class="label" width="20%">
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.deliverMessageAt"/>:		  
		  </td>
          <td class="labelField" width="80%">
            <bvhtml:time property="jobTime"/>
          </td>
		</tr>		
		</c:when>

        <c:when test='${formBeanMap.scheduleType == "bv_month"}'>
		<!-- ***** bv_month *** -->
		<tr>
		  <td class="label" width="20%">
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.selectADay"/>:		  
		  </td>
          <td class="labelField" width="80%">
            <div class="labelField" width="80%">	
              <html:radio property="monthDayType" value="0" onclick="clearMonthDay()"/>
			  <bean:message bundle="em" key="emarketing.notif.emailCreate.label.firstDayOfTheMonth"/>
			</div>
			<div class="labelField" width="80%">
			  <html:radio property="monthDayType" value="1" onclick="clearMonthDay()"/>
			  <bean:message bundle="em" key="emarketing.notif.emailCreate.label.lastDayOfTheMonth"/>
			</div>
			<div class="labelField" width="80%">
			  <html:radio property="monthDayType" value="2"/>
			  <bean:message bundle="em" key="emarketing.notif.emailCreate.label.specificDayOfTheMonth"/>:
			  <html:select property="monthDay">
			    <%-- the labels and values of the daysOfMonth drop down are the same. --%>
				<html:options name="viewBean" property="daysOfMonth"/>
			  </html:select>						
			</div>
          </td>
        </tr>
		<tr>
		  <td class="label" width="20%">
            <bean:message bundle="em" key="emarketing.notif.emailCreate.label.deliverMessageAt"/>:		  
		  </td>
          <td class="labelField" width="80%">
            <bvhtml:time property="jobTime"/>
          </td>
		</tr>		
		</c:when>        	
        </c:choose>				
      </table>

      <div class="pageButtonWrap" align="right">          
        <input type="button"    name="resetButton"
                      class="inputButton"
                      value="<bean:message bundle="em" key="button.reset"/>"
                      onClick="doReset(this.form);"> &nbsp;&nbsp;
	    <input type="button" name="cancelButton"
                      class="inputButton" 
                      value="<bean:message bundle="em" key="button.cancel"/>"
                      onClick="doCancel(this.form);"/> 
        <c:choose>
          <c:when test='${formBeanMap.currentAction == "create"}'>
          <!-- use "Save and Continue" button for create new email/alert action -->
          <input type="button" name="saveButton"
                      class="inputButton"
                      value="<bean:message bundle="em" key="button.savecont"/>"
                      onClick="doSave(this.form);"/>
          </c:when>
          <c:when test='${formBeanMap.currentAction == "edit"}'>
          <!-- use "Save" button for edit existing email/alert action -->
          <input type="button" name="saveButton"
                      class="inputButton"
                      value="<bean:message bundle="em" key="button.save"/>"
                      onClick="doSave(this.form);"/>
          </c:when>
        </c:choose>

      </div>
  	</html-el:form>
  	
    </td>
  </tr>

<!--end zone 5 content area-->
</table>

